package com.skivingcloud.report.config;


import com.skivingcloud.report.constants.ReportConstant;

import java.util.HashMap;
import java.util.Map;

public class DataSourceConfig {

	private final String id;
    private final String driverClass;
    private final String jdbcUrl;
    private final String user;
    private final String password;
    private final Map<String, Object> options;


    public DataSourceConfig(final String id, final String type, final String jdbcUrl, final String user,
                            final String password,
                            final String queryerClass, final String dbPoolClass) {
        this(id, type, jdbcUrl, user, password, new HashMap<>(3));
    }

    public DataSourceConfig(final String id, final String type, final String jdbcUrl, final String user,
                            final String password,
                            final Map<String, Object> options) {
        this.id = id;
        this.driverClass = ReportConstant.DRIVER_CLASS_MAP.get(type);
        this.jdbcUrl = jdbcUrl;
        this.user = user;
        this.password = password;
        this.options = options;
    }

    public String getId() {
        return id;
    }

    public String getDriverClass() {
        return driverClass;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public String getUser() {
        return user;
    }

    public String getPassword() {
        return password;
    }

    public Map<String, Object> getOptions() {
        return options;
    }
}
